home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / Internet / Misc / InternetConfigProgKit1.0.sit / ICProgKit1.0 / Examples / CExample.c next >
MacBinary  |  1994-11-12  |  2.1 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Nov 12 00:20:44 1994, modified Sat Nov 12 00:20:44 1994, creator 'MPS ', type ASCII, 1531 bytes "CExample.c" , at 0x67b 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 43 45 78 61 6d 70 | 6c 65 2e 63 00 00 00 00 |..CExamp|le.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 05 fb 00 | 00 01 ac aa ea 01 2c aa |........|......,.|
|00000060| ea 01 2c 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..,.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 fe 77 00 00 |........|.....w..|
|00000080| 23 69 6e 63 6c 75 64 65 | 20 3c 73 74 64 69 6f 2e |#include| <stdio.|
|00000090| 68 3e 0d 0d 23 69 6e 63 | 6c 75 64 65 20 3c 54 79 |h>..#inc|lude <Ty|
|000000a0| 70 65 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |pes.h>.#|include |
|000000b0| 3c 46 69 6c 65 73 2e 68 | 3e 0d 0d 23 69 66 6e 64 |<Files.h|>..#ifnd|
|000000c0| 65 66 20 54 48 49 4e 4b | 5f 43 0d 23 69 6e 63 6c |ef THINK|_C.#incl|
|000000d0| 75 64 65 20 3c 53 74 72 | 69 6e 67 73 2e 68 3e 0d |ude <Str|ings.h>.|
|000000e0| 23 65 6e 64 69 66 0d 0d | 23 69 6e 63 6c 75 64 65 |#endif..|#include|
|000000f0| 20 3c 49 43 54 79 70 65 | 73 2e 68 3e 0d 23 69 6e | <ICType|s.h>.#in|
|00000100| 63 6c 75 64 65 20 3c 49 | 43 41 50 49 2e 68 3e 0d |clude <I|CAPI.h>.|
|00000110| 23 69 6e 63 6c 75 64 65 | 20 3c 49 43 4b 65 79 73 |#include| <ICKeys|
|00000120| 2e 68 3e 0d 0d 76 6f 69 | 64 20 44 75 6d 70 50 72 |.h>..voi|d DumpPr|
|00000130| 65 66 73 28 76 6f 69 64 | 29 3b 0d 0d 49 43 49 6e |efs(void|);..ICIn|
|00000140| 73 74 61 6e 63 65 20 69 | 6e 73 74 3b 0d 0d 6d 61 |stance i|nst;..ma|
|00000150| 69 6e 20 28 29 20 7b 0d | 09 49 43 45 72 72 6f 72 |in () {.|.ICError|
|00000160| 20 65 72 72 3b 0d 09 49 | 43 44 69 72 53 70 65 63 | err;..I|CDirSpec|
|00000170| 41 72 72 61 79 20 66 6f | 6c 64 65 72 5f 73 70 65 |Array fo|lder_spe|
|00000180| 63 3b 0d 09 53 74 72 32 | 35 35 20 65 6d 61 69 6c |c;..Str2|55 email|
|00000190| 5f 61 64 64 72 65 73 73 | 3b 0d 09 6c 6f 6e 67 20 |_address|;..long |
|000001a0| 61 74 74 72 3b 0d 09 6c | 6f 6e 67 20 73 69 7a 65 |attr;..l|ong size|
|000001b0| 3b 0d 09 6c 6f 6e 67 20 | 73 65 65 64 3b 0d 0d 09 |;..long |seed;...|
|000001c0| 65 72 72 20 3d 20 49 43 | 53 74 61 72 74 28 26 69 |err = IC|Start(&i|
|000001d0| 6e 73 74 2c 20 27 43 52 | 45 41 27 29 3b 09 09 09 |nst, 'CR|EA');...|
|000001e0| 2f 2a 20 74 65 6c 6c 20 | 69 74 20 79 6f 75 72 20 |/* tell |it your |
|000001f0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 20 63 72 65 61 |applicat|ion crea|
|00000200| 74 6f 72 20 2a 2f 0d 09 | 70 72 69 6e 74 66 28 22 |tor */..|printf("|
|00000210| 49 43 53 74 61 72 74 3a | 20 25 6c 64 5c 6e 22 2c |ICStart:| %ld\n",|
|00000220| 20 65 72 72 29 3b 0d 0d | 09 66 6f 6c 64 65 72 5f | err);..|.folder_|
|00000230| 73 70 65 63 5b 30 5d 2e | 76 52 65 66 4e 75 6d 20 |spec[0].|vRefNum |
|00000240| 3d 20 2d 31 3b 09 09 09 | 09 09 09 09 09 2f 2a 20 |= -1;...|...../* |
|00000250| 73 65 61 72 63 68 20 66 | 6f 72 20 70 72 65 66 73 |search f|or prefs|
|00000260| 20 69 6e 20 72 6f 6f 74 | 20 6f 66 20 74 68 65 20 | in root| of the |
|00000270| 73 79 73 74 65 6d 20 2a | 2f 0d 09 66 6f 6c 64 65 |system *|/..folde|
|00000280| 72 5f 73 70 65 63 5b 30 | 5d 2e 64 69 72 49 44 20 |r_spec[0|].dirID |
|00000290| 3d 20 32 3b 09 09 09 09 | 09 09 09 09 09 09 2f 2a |= 2;....|....../*|
|000002a0| 20 76 6f 6c 75 6d 65 2c | 20 6f 62 76 69 6f 75 73 | volume,| obvious|
|000002b0| 6c 79 20 79 6f 75 27 64 | 20 75 73 65 20 6f 74 68 |ly you'd| use oth|
|000002c0| 65 72 20 74 68 69 6e 67 | 73 20 2a 2f 0d 09 65 72 |er thing|s */..er|
|000002d0| 72 20 3d 20 49 43 46 69 | 6e 64 43 6f 6e 66 69 67 |r = ICFi|ndConfig|
|000002e0| 46 69 6c 65 28 69 6e 73 | 74 2c 20 31 2c 20 28 49 |File(ins|t, 1, (I|
|000002f0| 43 44 69 72 53 70 65 63 | 41 72 72 61 79 50 74 72 |CDirSpec|ArrayPtr|
|00000300| 29 20 26 66 6f 6c 64 65 | 72 5f 73 70 65 63 29 3b |) &folde|r_spec);|
|00000310| 0d 09 70 72 69 6e 74 66 | 28 22 49 43 46 69 6e 64 |..printf|("ICFind|
|00000320| 43 6f 6e 66 69 67 46 69 | 6c 65 3a 20 25 6c 64 5c |ConfigFi|le: %ld\|
|00000330| 6e 22 2c 20 65 72 72 29 | 3b 0d 0d 09 65 72 72 20 |n", err)|;...err |
|00000340| 3d 20 49 43 42 65 67 69 | 6e 28 69 6e 73 74 2c 20 |= ICBegi|n(inst, |
|00000350| 69 63 52 65 61 64 57 72 | 69 74 65 50 65 72 6d 29 |icReadWr|itePerm)|
|00000360| 3b 0d 09 70 72 69 6e 74 | 66 28 22 49 43 42 65 67 |;..print|f("ICBeg|
|00000370| 69 6e 3a 20 25 6c 64 5c | 6e 22 2c 20 65 72 72 29 |in: %ld\|n", err)|
|00000380| 3b 0d 09 73 69 7a 65 20 | 3d 20 73 69 7a 65 6f 66 |;..size |= sizeof|
|00000390| 28 65 6d 61 69 6c 5f 61 | 64 64 72 65 73 73 29 3b |(email_a|ddress);|
|000003a0| 0d 09 65 72 72 20 3d 20 | 49 43 47 65 74 50 72 65 |..err = |ICGetPre|
|000003b0| 66 28 69 6e 73 74 2c 20 | 22 5c 70 45 6d 61 69 6c |f(inst, |"\pEmail|
|000003c0| 22 2c 20 26 61 74 74 72 | 2c 20 28 50 74 72 29 20 |", &attr|, (Ptr) |
|000003d0| 65 6d 61 69 6c 5f 61 64 | 64 72 65 73 73 2c 20 26 |email_ad|dress, &|
|000003e0| 73 69 7a 65 29 3b 0d 09 | 70 72 69 6e 74 66 28 22 |size);..|printf("|
|000003f0| 49 43 47 65 74 50 72 65 | 66 3a 20 25 6c 64 5c 6e |ICGetPre|f: %ld\n|
|00000400| 22 2c 20 65 72 72 29 3b | 0d 09 0d 09 70 32 63 73 |", err);|....p2cs|
|00000410| 74 72 28 65 6d 61 69 6c | 5f 61 64 64 72 65 73 73 |tr(email|_address|
|00000420| 29 3b 0d 09 70 72 69 6e | 74 66 28 22 59 6f 75 72 |);..prin|tf("Your|
|00000430| 20 45 6d 61 69 6c 20 61 | 64 64 72 65 73 73 20 69 | Email a|ddress i|
|00000440| 73 20 25 73 5c 6e 22 2c | 20 65 6d 61 69 6c 5f 61 |s %s\n",| email_a|
|00000450| 64 64 72 65 73 73 29 3b | 0d 09 44 75 6d 70 50 72 |ddress);|..DumpPr|
|00000460| 65 66 73 28 29 3b 0d 09 | 65 72 72 20 3d 20 49 43 |efs();..|err = IC|
|00000470| 45 6e 64 28 69 6e 73 74 | 29 3b 0d 09 70 72 69 6e |End(inst|);..prin|
|00000480| 74 66 28 22 49 43 45 6e | 64 3a 20 25 6c 64 5c 6e |tf("ICEn|d: %ld\n|
|00000490| 22 2c 20 65 72 72 29 3b | 0d 0d 09 65 72 72 20 3d |", err);|...err =|
|000004a0| 20 49 43 47 65 74 53 65 | 65 64 28 69 6e 73 74 2c | ICGetSe|ed(inst,|
|000004b0| 20 26 73 65 65 64 29 3b | 0d 09 70 72 69 6e 74 66 | &seed);|..printf|
|000004c0| 28 22 49 43 47 65 74 53 | 65 65 64 3a 20 25 6c 64 |("ICGetS|eed: %ld|
|000004d0| 20 3d 20 25 6c 64 5c 6e | 22 2c 20 65 72 72 2c 20 | = %ld\n|", err, |
|000004e0| 73 65 65 64 29 3b 0d 09 | 2f 2a 20 6e 6f 77 20 6d |seed);..|/* now m|
|000004f0| 6f 6e 69 74 6f 72 20 74 | 68 69 73 20 73 65 65 64 |onitor t|his seed|
|00000500| 20 74 6f 20 73 65 65 20 | 69 66 20 61 6e 79 20 70 | to see |if any p|
|00000510| 72 65 66 65 72 65 6e 63 | 65 73 20 68 61 76 65 20 |referenc|es have |
|00000520| 63 68 61 6e 67 65 64 20 | 2a 2f 0d 0d 09 65 72 72 |changed |*/...err|
|00000530| 20 3d 20 49 43 53 74 6f | 70 28 69 6e 73 74 29 3b | = ICSto|p(inst);|
|00000540| 0d 09 70 72 69 6e 74 66 | 28 22 49 43 53 74 6f 70 |..printf|("ICStop|
|00000550| 3a 20 25 6c 64 5c 6e 22 | 2c 20 65 72 72 29 3b 0d |: %ld\n"|, err);.|
|00000560| 7d 0d 0d 76 6f 69 64 20 | 44 75 6d 70 50 72 65 66 |}..void |DumpPref|
|00000570| 73 28 29 0d 7b 0d 09 49 | 43 45 72 72 6f 72 20 65 |s().{..I|CError e|
|00000580| 72 72 3b 0d 09 6c 6f 6e | 67 20 63 6f 75 6e 74 3b |rr;..lon|g count;|
|00000590| 0d 09 6c 6f 6e 67 20 69 | 3b 0d 09 53 74 72 32 35 |..long i|;..Str25|
|000005a0| 35 20 6b 65 79 3b 0d 09 | 0d 09 65 72 72 20 3d 20 |5 key;..|..err = |
|000005b0| 49 43 43 6f 75 6e 74 50 | 72 65 66 28 69 6e 73 74 |ICCountP|ref(inst|
|000005c0| 2c 20 26 63 6f 75 6e 74 | 29 3b 0d 09 70 72 69 6e |, &count|);..prin|
|000005d0| 74 66 28 22 49 43 43 6f | 75 6e 74 50 72 65 66 3a |tf("ICCo|untPref:|
|000005e0| 20 25 6c 64 5c 6e 22 2c | 20 65 72 72 29 3b 0d 09 | %ld\n",| err);..|
|000005f0| 66 6f 72 20 28 69 20 3d | 20 31 3b 20 69 20 3c 3d |for (i =| 1; i <=|
|00000600| 20 63 6f 75 6e 74 3b 20 | 69 2b 2b 29 20 7b 0d 09 | count; |i++) {..|
|00000610| 09 65 72 72 20 3d 20 49 | 43 47 65 74 49 6e 64 50 |.err = I|CGetIndP|
|00000620| 72 65 66 28 69 6e 73 74 | 2c 20 69 2c 20 6b 65 79 |ref(inst|, i, key|
|00000630| 29 3b 0d 09 09 70 32 63 | 73 74 72 28 6b 65 79 29 |);...p2c|str(key)|
|00000640| 3b 0d 09 09 70 72 69 6e | 74 66 28 22 20 20 49 43 |;...prin|tf(" IC|
|00000650| 47 65 74 49 6e 64 50 72 | 65 66 3a 20 25 6c 64 20 |GetIndPr|ef: %ld |
|00000660| 2d 20 25 73 5c 6e 22 2c | 20 65 72 72 2c 20 26 6b |- %s\n",| err, &k|
|00000670| 65 79 29 3b 0d 09 7d 3b | 0d 7d 0d 00 00 00 00 00 |ey);..};|.}......|
|00000680| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00000690| 33 45 38 30 3b 0d 46 55 | 4e 43 54 49 4f 4e 20 50 |3E80;.FU|NCTION P|
|000006a0| 42 53 65 74 45 4f 46 28 | 70 61 72 61 6d 42 6c 6f |BSetEOF(|paramBlo|
|000006b0| 0a 43 45 78 61 6d 70 6c | 65 2e 63 00 02 00 00 00 |.CExampl|e.c.....|
|000006c0| 54 45 58 54 4d 50 53 20 | 01 00 00 14 00 00 00 00 |TEXTMPS |........|
|000006d0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 14 00 00 |..TEXTMP|S ......|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 5d 6f a9 a6 e5 13 00 00 | 05 fb 00 00 01 ac 6c 6b |]o......|......lk|
|00000700| 50 74 72 29 3a 20 4f 53 | 45 72 72 3b 0d 20 49 4e |Ptr): OS|Err;. IN|
|00000710| 4c 49 4e 45 20 24 32 30 | 35 46 2c 24 41 30 31 32 |LINE $20|5F,$A012|
|00000720| 2c 24 33 45 38 30 3b 0d | 46 55 4e 43 54 49 4f 4e |,$3E80;.|FUNCTION|
|00000730| 20 50 42 53 65 74 45 4f | 46 41 73 79 6e 63 28 70 | PBSetEO|FAsync(p|
|00000740| 61 72 61 6d 42 6c 6f 63 | 6b 3a 20 50 61 72 6d 42 |aramBloc|k: ParmB|
|00000750| 6c 6b 50 74 72 29 3a 20 | 4f 53 45 72 72 3b 0d 20 |lkPtr): |OSErr;. |
|00000760| 49 4e 4c 49 4e 45 20 24 | 32 30 35 46 2c 24 41 34 |INLINE $|205F,$A4|
|00000770| 31 32 2c 24 33 45 38 30 | 3b 0d 46 55 4e 43 54 49 |12,$3E80|;.FUNCTI|
|00000780| 00 00 00 1e 00 2a 00 03 | 01 d1 01 ff 00 50 00 20 |.....*..|.....P. |
|00000790| 01 dd 02 3d 00 00 00 00 | 00 00 00 00 00 00 00 00 |...=....|........|
|000007a0| 00 00 00 00 00 48 00 09 | 4d 6f 6e 61 63 6f 00 00 |.....H..|Monaco..|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 06 00 02 00 2a 00 03 |........|.....*..|
|000007d0| 01 dd 02 7d 00 35 00 04 | 01 dc 02 00 aa e9 ba de |...}.5..|........|
|000007e0| 00 00 00 0a 00 00 00 0a | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 38 |.....n..|.n...>.8|
|00000800| e0 8c 0a 4a 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |...J....|.>..MPSR|
|00000810| 00 01 00 0a 03 f0 ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00000820| 03 ed ff ff 00 00 00 22 | 00 38 df 48 00 00 00 00 |......."|.8.H....|
|00000830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+